#include "visualizadorAbstrato.h"
#include "visualizadorListaLigadaStl.h"
//------------------------------------------------------------------------------
visualizadorListaLigadaStl::visualizadorListaLigadaStl(float x,float y):visualizadorAbstrato(x,y)
{
	lstListaLigadaStl = new ListaLigadaStl;
};
//------------------------------------------------------------------------------
visualizadorListaLigadaStl::~visualizadorListaLigadaStl()
{
	delete lstListaLigadaStl;
	lstListaLigadaStl = NULL;
};
//------------------------------------------------------------------------------
void visualizadorListaLigadaStl::desenha(TImage *area, double escalaX, double escalaY)const
{
		area->Canvas->Brush->Color = clGreen;
		area->Canvas->Rectangle((getX())*escalaX,(getY())*escalaY,(getX()+44)*escalaX,(getY()+44)*escalaY);
		if(escalaX == 1)
		{
				area->Canvas->Brush->Color = clWhite;
				area->Canvas->Rectangle((getX()+2)*escalaX,(getY()+6)*escalaY,(getX()+25)*escalaX,(getY()+37)*escalaY);

				//linhas da lista
				area->Canvas->MoveTo(getX()+5,getY()+10);
				area->Canvas->LineTo(getX()+20,getY()+10);

				area->Canvas->MoveTo(getX()+5,getY()+10);
				area->Canvas->LineTo(getX()+5,getY()+25);

				area->Canvas->MoveTo(getX()+5,getY()+13);
				area->Canvas->LineTo(getX()+20,getY()+13);

				area->Canvas->MoveTo(getX()+20,getY()+13);
				area->Canvas->LineTo(getX()+20,getY()+25);  

				area->Canvas->MoveTo(getX()+5,getY()+16);
				area->Canvas->LineTo(getX()+20,getY()+16);
				area->Canvas->MoveTo(getX()+5,getY()+19);
				area->Canvas->LineTo(getX()+20,getY()+19);
				area->Canvas->MoveTo(getX()+5,getY()+22);
				area->Canvas->LineTo(getX()+20,getY()+22);
				area->Canvas->MoveTo(getX()+5,getY()+25);
				area->Canvas->LineTo(getX()+20,getY()+25);

				//texto
				area->Canvas->TextOutA((getX()+6)*escalaX,(getY()+29)*escalaY,"Lista_Stl" +IntToStr(getIdentidade()));   
		 }
};
//------------------------------------------------------------------------------
void visualizadorListaLigadaStl::interage()
{
	TfrmListaLigadaStl * frmListaSimplesStl = new TfrmListaLigadaStl(Application, lstListaLigadaStl);
	frmListaSimplesStl->ShowModal();
	delete(frmListaSimplesStl);
	frmListaSimplesStl = NULL;
};
//------------------------------------------------------------------------------

